home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / MM2_DEV / S / MYUTIL / TIMECHK.M < prev    next >
Encoding:
Text File  |  1990-12-05  |  2.7 KB  |  87 lines

  1. (*$c-*)
  2. module TimeChk;
  3.  
  4. (*
  5.   Druchsucht ab Startverzeichnis alle Subdirs und sucht nach Files/Dirs,
  6.   die nach einem bestimmbaren Datum liegen.
  7. *)
  8.  
  9. (*$E mos *)
  10. import moreio;
  11. from inout import OpenOutput, writeln, WriteString, readstring, write, read,
  12.         CloseOutput, writeint;
  13. from directory import dirquery, direntry, fileattr, fileattrset;
  14. from mosglobals import date, time;
  15. from timeconvert import texttotime, texttodate;
  16. from clock import packtime, packdate;
  17. import filenames, strings;
  18.  
  19. var ch:char;
  20.     res:INTEGER;
  21.     level:CARDINAL;
  22.     d:Date; t:Time;
  23.     pd, pt: CARDINAL;
  24.     b: BOOLEAN;
  25.  
  26.  
  27. PROCEDURE showentry (REF path:ARRAY OF CHAR; e:direntry):BOOLEAN;
  28.   var res:integer; i:CARDINAL; p:ARRAY [0..142] of char; b:BOOLEAN; c:char;
  29.   begin
  30.     if (packdate (e.date) > pd)
  31.     or (packdate (e.date) = pd) & (packtime(e.time) >= pt) then
  32.       if e.name[0]#'.' then
  33.         WriteString (path);
  34.         writestring (e.name);
  35.         IF subdirAttr IN e.attr THEN
  36.           write ('\')
  37.         end;
  38.         writeln;
  39.       end;
  40.     end;
  41.     IF subdirAttr IN e.attr THEN
  42.       if e.name[0]#'.' then
  43.         strings.concat (e.name,'\',p,b);
  44.         strings.concat (path,p,p,b);
  45.         strings.concat (p,'*.*',p,b);
  46.         dirquery (p,FileAttrSet{subdirAttr},showentry,res);
  47.         if res<0 then writeint (res,0); writeln; end;
  48.       end
  49.     end;
  50.     return true
  51.   end showentry;
  52.  
  53. VAR s,p: ARRAY [0..127] of char;
  54.  
  55. begin
  56.   level:=0;
  57.   WriteString ('Root dir? ');
  58.   ReadString (p);
  59.   filenames.validatepath (p);
  60.   strings.append ('*.*',p,b);
  61.   repeat
  62.     WriteString ('Date? ');
  63.     readString(s);
  64.     if s[0]=0C then return end;
  65.     texttodate (s, 0, d, b);
  66.   until b;
  67.   repeat
  68.     WriteString ('Time? ');
  69.     readString(s);
  70.     if s[0]=0C then return end;
  71.     texttotime (s, t, b);
  72.   until b;
  73.   pd:= packdate(d);
  74.   pt:= packtime(t);
  75.   WriteString ('Ausgabedatei? ');
  76.   OpenOutput ('TXT');
  77.   dirquery (p,FileAttrSet{subdirAttr},showentry,res);
  78.   CloseOutput;
  79.   if res<0 then
  80.     writeint (res,0);
  81.   else
  82.     writestring ('OK.')
  83.   end;
  84. end TimeChk.
  85. ə
  86. (* $FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFEAC9B4$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DE$FFFB32DEÇ$000003D6T.......T.......T.......T.......T.......T.......T.......T.......T.......T.......$000003B7$FFEAC9A6$0000057E$00000445$0000037B$FFEAC9A6$0000037B$00000413$0000037E$0000038B$FFEAC9A6$00000409$FFEAC9A6$0000043B$000003D6$0000043BäÇÇ*)
  87.